home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 5⁄11⁄90 / 0122-Re >> copy vs op+ & -May90 next >
Encoding:
Text File  |  1990-05-11  |  983 b   |  25 lines  |  [TEXT/GEOL]

  1. Item    4313766                         6-May-90        20:21PDT
  2.  
  3. From:   MIKE.VILOT                      ObjectWare, Michael Vilot,PRT
  4.  
  5. To:     M.DANIEL                        Daniel Scientific, M Daniel,PRT
  6.  
  7. cc:     CPLUS.APPLE$                    C++ Interest List--Apple Employees
  8.         CPLUS.DEV$                      C++ Interest List--Developers
  9.  
  10. Sub:    RE>>> copy vs op+ & const
  11.  
  12. > with "operator int();"
  13. If you take a look at Jerry Schwarz's Iostream library, you'll
  14. see that he uses "operator void*()" for this purpose.  He also
  15. defines "operator!()" for the complementary test.
  16.   The main reason for preferring void* over int is that generic
  17. pointers are not implicitly converted _to_ any other types, as
  18. are int values (see Sections 4.5 and 4.6 of the Reference Manual).
  19. This helps to insure that the status test is in fact the point
  20. of using the implicit conversion in the expression.  It also
  21. preserves "operator int()" for arithmetic conversions.
  22.  
  23.     Mike
  24.  
  25.